package com.youbar.dto;

import com.youbar.entity.User;

import java.io.Serializable;

/**
 * 用户登录数据
 */
public class LoginInfoDto implements Serializable {

    private static final long serialVersionUID = 1L;

    private String name;
    private String nickName;
    // 权限，由用户权限拼接而成
    private String authStr;
    private int id;
    /**
     * 用户账号状态
     */
    private int state;
    private String avatar;

    public LoginInfoDto(User user){
        this.name = user.getName();
        this.nickName = user.getNickName();
        this.id = user.getId();
        this.state = user.getState();
        this.avatar = user.getAvatar();
        StringBuilder sb = new StringBuilder(",");
        this.authStr = sb.toString();
    }

    public String getName() {
        return name;
    }

    public String getNickName() {
        return nickName;
    }

    public String getAuthStr() {
        return authStr;
    }

    public int getId() {
        return id;
    }

    public int getState() {
        return state;
    }

    public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

}
